<!DOCTYPE html>
<html>
<head>
    <title>包材供应商</title>
    {% include 'system/common/header.html' %}
</head>
<body>
<form class="layui-form">
    <div class="mainBox">
        <div class="main-container">
            <div class="main-container">
                <div class="layui-card-body">
                    <div class="layui-tab layui-tab-brief">
                         <ul class="layui-tab-title">
                        <li class="layui-this">供应商信息</li>
                             <li>其他信息</li>
                             <li>仓库信息</li>
                        <li>开票信息</li>
                             <li>供应物料</li>
                        </ul>
                        <div class="layui-tab-content">
                            <div class="layui-tab-item layui-show">
                               <div class="layui-form-item">
                                    <label class="layui-form-label">供应商名</label>
                                    <div class="layui-input-block">
                                        <input type="text" name="供应商名"  lay-verify="required"  lay-reqtext="请填写供应商名" autocomplete="off" placeholder="请输入内容"
                                               class="layui-input">
                                    </div>
                                </div>

                                <div class="layui-form-item">
                                    <label class="layui-form-label">身份信息</label>
                                    <div class="layui-input-block">
                                        <input type="text" name="身份信息" lay-verify="required"  ay-reqtext="请填写供应商身份信息" autocomplete="off" placeholder="请输入内容"
                                               class="layui-input">
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <label class="layui-form-label">注册地址</label>
                                    <div class="layui-input-block">
                                        <input type="text" name="注册地址"  autocomplete="off" placeholder="请输入内容"
                                               class="layui-input">
                                    </div>
                                </div>

                                <div class="layui-form-item">
                                    <label class="layui-form-label">归属类别</label>
                                    <div class="layui-input-block">
                                        <input type="text" name="归属类别"  autocomplete="off" placeholder="请输入内容"
                                               class="layui-input">
                                    </div>
                                </div>

                                <div class="layui-form-item">
                                    <label class="layui-form-label">状态</label>
                                    <div class="layui-input-block">
                                        <input type="radio" name="状态" value="1" title="开启">
                                        <input type="radio" name="状态" value="0" title="关闭" checked>
                                    </div>
                                </div>



                                <div class="layui-form-item">
                                    <label class="layui-form-label">备注</label>
                                    <div class="layui-input-block">
                                        <input type="text" name="备注"  autocomplete="off" placeholder="请输入内容"
                                               class="layui-input" value="">
                                    </div>
                                </div>
                            </div>
                            <div class="layui-tab-item">
                                <div class="layui-form-item">
                                    <label class="layui-form-label">联系人</label>
                                    <div class="layui-input-block">
                                        <input type="text" name="联系人"  autocomplete="off" placeholder="请输入内容"
                                               class="layui-input">
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <label class="layui-form-label">联系电话</label>
                                    <div class="layui-input-block">
                                        <input type="text" name="联系电话" lay-verify="phone" autocomplete="off" placeholder="请输入内容"
                                               class="layui-input">
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <label class="layui-form-label">最后一次审计日期</label>
                                    <div class="layui-input-block">
                                        <input type="text" name="最后一次审计日期" lay-verify="date" autocomplete="off" placeholder="请输入内容"
                                               class="layui-input" value="">
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <label class="layui-form-label">有效期至</label>
                                    <div class="layui-input-block">
                                        <input type="text" name="有效期至" lay-verify="required|date"  autocomplete="off" placeholder="请输入内容"
                                               class="layui-input" value="2024-10-16">
                                    </div>
                                </div>


                                <div class="layui-form-item">
                                    <label class="layui-form-label">审计周期</label>
                                    <div class="layui-input-block">
                                        <input type="text" name="审计周期" lay-verify="required|number" autocomplete="off" placeholder="请输入内容"
                                               class="layui-input" value="24">
                                    </div>
                                </div>

                            </div>
                            <div class="layui-tab-item">
                                <div class="layui-form-item">
                                    <label class="layui-form-label">仓库名称</label>
                                    <div class="layui-input-block">
                                        <input type="text" name="仓库名称"  autocomplete="off" placeholder="请输入内容"
                                               class="layui-input" >
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <label class="layui-form-label">仓库地址</label>
                                    <div class="layui-input-block">
                                        <input type="text" name="仓库地址"  autocomplete="off" placeholder="请输入内容"
                                               class="layui-input" >
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <label class="layui-form-label">仓库联系人</label>
                                    <div class="layui-input-block">
                                        <input type="text" name="仓库联系人"  autocomplete="off" placeholder="请输入内容"
                                               class="layui-input" >
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <label class="layui-form-label">仓库联系电话</label>
                                    <div class="layui-input-block">
                                        <input type="text" name="仓库联系电话" lay-verify="phone" autocomplete="off" placeholder="请输入内容"
                                               class="layui-input" >
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <label class="layui-form-label">仓库名称2</label>
                                    <div class="layui-input-block">
                                        <input type="text" name="仓库名称2"  autocomplete="off" placeholder="请输入内容"
                                               class="layui-input" >
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <label class="layui-form-label">仓库地址2</label>
                                    <div class="layui-input-block">
                                        <input type="text" name="仓库地址2"  autocomplete="off" placeholder="请输入内容"
                                               class="layui-input" >
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <label class="layui-form-label">仓库联系人2</label>
                                    <div class="layui-input-block">
                                        <input type="text" name="仓库联系人2"  autocomplete="off" placeholder="请输入内容"
                                               class="layui-input" >
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <label class="layui-form-label">仓库联系电话2</label>
                                    <div class="layui-input-block">
                                        <input type="text" name="仓库联系电话2" lay-verify="phone" autocomplete="off" placeholder="请输入内容"
                                               class="layui-input" >
                                    </div>
                                </div>



                            </div>
                            <div class="layui-tab-item">
                                    <div class="layui-form-item">
                                    <label class="layui-form-label">邮箱</label>
                                    <div class="layui-input-block">
                                        <input type="text" name="邮箱" lay-verify="email" autocomplete="off" placeholder="请输入内容"
                                               class="layui-input" >
                                    </div>
                                   </div>
                                    <div class="layui-form-item">
                                        <label class="layui-form-label">企业网址</label>
                                        <div class="layui-input-block">
                                            <input type="text" name="企业网址" lay-verify="url" autocomplete="off" placeholder="请输入内容"
                                                   class="layui-input" value="">
                                        </div>
                                    </div>
                                    <div class="layui-form-item">
                                        <label class="layui-form-label">开户行</label>
                                        <div class="layui-input-block">
                                            <input type="text" name="开户行"  autocomplete="off" placeholder="请输入内容"
                                                   class="layui-input" value="">
                                        </div>
                                    </div>
                                    <div class="layui-form-item">
                                        <label class="layui-form-label">收款单位</label>
                                        <div class="layui-input-block">
                                            <input type="text" name="收款单位"  autocomplete="off" placeholder="请输入内容"
                                                   class="layui-input" value="">
                                        </div>
                                    </div>
                                    <div class="layui-form-item">
                                        <label class="layui-form-label">账号</label>
                                        <div class="layui-input-block">
                                            <input type="text" name="账号"  autocomplete="off" placeholder="请输入内容"
                                                   class="layui-input" >
                                        </div>
                                    </div>
                                    <div class="layui-form-item">
                                        <label class="layui-form-label">质保体系评估结果</label>
                                        <div class="layui-input-block">
                                            <input type="text" name="质保体系评估结果"  autocomplete="off" placeholder="请输入内容"
                                                   class="layui-input" value="D">
                                        </div>
                                    </div>
                            </div>
                            <div class="layui-tab-item">
                               <div id="ID-transfer-showSearch"></div>
                            </div>
                        </div>
                   </div>
                </div>










            </div>
        </div>
    </div>
    <div class="bottom">
        <div class="button-container">
            <button type="submit" class="pear-btn pear-btn-primary pear-btn-sm" lay-submit="" lay-filter="user-save">
                <i class="layui-icon layui-icon-ok"></i>
                提交
            </button>
            <button type="reset" class="pear-btn pear-btn-sm">
                <i class="layui-icon layui-icon-refresh"></i>
                重置
            </button>
        </div>
    </div>
</form>
{% include 'system/common/footer.html' %}
<script>
  layui.use(['form', 'jquery'], function () {
    let form = layui.form
    let $ = layui.jquery
    var laydate = layui.laydate;
    var transfer = layui.transfer;
      // 渲染
     laydate.render({
        elem: '#ID-laydate-demo'
      });
     //物料实例渲染

    $.ajax({
        url: '/supplier/auxiliary/yp/raw',
        data: '',
        dataType: 'json',
        contentType: 'application/json',
        type: 'get',
        success: function (result) {

          // 渲染
          transfer.render({
            elem: '#ID-transfer-showSearch',
            data: result,
            title: ['所有物料', '审计的物料'],
            showSearch: true,
              id:'transfer_raws'
          });

        },

    })


    form.on('submit(user-save)', function (data) {

        // 获得右侧数据
        var getData = transfer.getData('transfer_raws');

      data.field.rawIds = getData

      {#  layer.alter(getData)#}
      $.ajax({
        url: '/supplier/auxiliary/yp/save',
        data: JSON.stringify(data.field),
        dataType: 'json',
        contentType: 'application/json',
        type: 'post',
        success: function (result) {
          if (result.success) {
            layer.msg(result.msg, { icon: 1, time: 1000 }, function () {
              parent.layer.close(parent.layer.getFrameIndex(window.name))//关闭当前页
              parent.layui.table.reload('user-table')
            })
          } else {
            layer.msg(result.msg, { icon: 2, time: 5000 })
          }
        }
      })
      return false
    })
  })
</script>
<script>
</script>
</body>
</html>